package com.softcomputo.decodificador;

import com.softcomputo.decodificador.impl.DicomReaderImpl;

import java.io.File;
import java.io.FileInputStream;

/**
 * @author Luis Miguel Hernández Pérez
 */
public final class DicomReaderFactory {

    @SuppressWarnings("resource")
	public static byte[] convertirDicomAByteArray(File fileDicom) throws Exception {
        byte[] bs = new byte[(int) fileDicom.length()];
        new FileInputStream(fileDicom).read(bs);
        return bs;
    }

    public static DicomReader crearDicomReader(File fileDicom) throws Exception {
        return crearDicomReader(convertirDicomAByteArray(fileDicom));
    }

    public static DicomReader crearDicomReader(byte[] dicomByteArray) {
          return  new DicomReaderImpl(new DicomReaderH(dicomByteArray));
    }
    
  
}
